The Extensible Markup Language (XML) is commonly used for publishing and sharing structured and semi-structured data over the World Wide Web. XPath and XQuery are query languages for querying XML data. XML data in relational, object-relational and object databases may range from highly structured to highly unstructured. The structure of. stored XML data may be known at compile time, according to various storage models. Such models include the following:
XML Schema-conformant XML: the XML data in the tables may conform to an XML Schema document. The structure of the XML data is provided by the XML Schema document.
XML operator view: the XML data may be generated from relational data stored in tables, using XML generation operators. The structure of the XML data is provided by the structure of the XML generation operators, such as XML element (e.g., XMLElement) and XML aggregate (e.g., XMLAgg) operators.
XML-ized object view: the XML data may be generated by converting object-relational and object data to XML. The structure of the XML data is provided by the structure of the objects.
Opaque XML data: the XML data may be XML natively stored in an opaque format in the database. The structure of the XML data may be provided by auxiliary type information stored with the XML data instance.
XQuery-based data: the XML data may be generated as a result of the evaluation of an XQuery expression, such as the result of the XMLTable construct or the XMLQuery( ) function. The structure of the XML data may be provided by type information stored with the XML.
User-defined XML generation: the XML data may be generated as a result of user-defined and/or native functions. The structure of the XML data may be given by type information returned by the function.
Repository data: the XML data may be generated from the repository. The structure of the XML data may be given by one of the above schemes, along with type information based on the repository, such as hierarchical information.
Additionally, the structure of the XML data may be known at compile-time based on various other schemes. The structure of the XML data may also be given by a combination of one or more of the above schemes, as well as by a combination of zero or more of the above schemes along with one of various other schemes used to structure XML data.
Because of the widespread use of XML data, evolution of XML schemas to which XML data conforms, and the diverse storage models available for XML data, there is room for improvement in efficiently executing XML queries.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.